/*
动态参数服务端：解析动态参数


*/
#include "ros/ros.h"
#include "dynamic_reconfigure/server.h"
#include "demo02_dr/drConfig.h"

void cb(demo02_dr::drConfig &config, uint32_t level)
{
    ROS_INFO("动态参数解析数据:%d,%.2f,%d,%s,%d",
        config.int_param,
        config.double_param,
        config.bool_param,
        config.string_param.c_str(),
        config.list_param
    );
}

int main(int argc, char *argv[])
{
    //初始化操作
    setlocale(LC_ALL, "");
    ros::init(argc, argv, "dr_server");
    ros::NodeHandle nh;
    //创建服务器对象
    dynamic_reconfigure::Server<demo02_dr::drConfig> server;
    //当参数修改时，对象回调函数
    // dynamic_reconfigure::Server<demo02_dr::drConfig>::setCallback(const boost::function<
    // void (demo02_dr::drConfig &, uint32_t level)> &callback)
    server.setCallback(boost::bind(cb, _1, _2));
    //回旋
    ros::spin();
    return 0;
}
